-
Notifications
You must be signed in to change notification settings - Fork 905
Redid yolo object detection (2.0) #335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/YOLO/utils.js
Outdated
ctx.rect(item.x, item.y, item.w, item.h); | ||
ctx.stroke(); | ||
ctx.fillStyle = color; | ||
if (item.y - 25 >= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can replace all of this if-else with a ternary.
Also it's better to have < than >= or > than <=.
const yLessThanZero = item.y - 25 < 0;
ctx.fillRect(item.x - 1.5, item.y - 1.5, 90, yLessThanZero? 20 : -15);
ctx.fillStyle = '#000000';
ctx.fillText(txt, item.x, yLessThanZero ? item.y + 12 : item.y - 5 );
wow i forgot this even existed xD ? @henrmota give me few days and i ll will work on it , i am just about to finish my semester finals this week 😂 |
Hello + Greetings! First of all, I want to thank you for your hard work and ingenuity here on this PR. This was no small task and you did wonderful work here. Next, I'd just like to apologize that we were not able to pull your work in while we could. I know it can be a bummer when you work so hard on something and it seems like it isn't receiving the attention it deserves. Last, since YOLO is no longer part of ml5 (technically it still is living, but we have a deprecation notice for this since the coco-ssd model is the preferred method now in ml5), I think it would be best to close up this PR. For what it is worth: we have added you to our contributors list -- https://github.com/ml5js/ml5-library#contributors 🎊 I hope you're well! |
→ Description 📝
and i gave it a performance boost
a normal usage example should look like this
→ Screenshots 🖼
i will add some soon
→ Relevant Example or Paired Pull Request to ml5-examples 🦄
ml5js/ml5-examples#107
→ Relevant documentation 🌴
Note : the user is not obliged to always fill all the parameters :
i have put some example configurations with their models&weights in ml5js/ml5-examples#107